package com.gjsh.a_method;

public class Demo02 {
    public static void main(String[] args) {
        System.out.println(method("-", "8", "8", "8", "8", "8", "8", "8"));
    }

    public static String method(String regex, String... arr) {
        String link = "";
        if (arr.length == 0) {
            return link;
        } else {
            for (int i = 0; i < arr.length; i++) {
                if (i == arr.length - 1) {
                    link = link + arr[i];
                } else {
                    link = link + arr[i] + regex;

                }
            }
            return link;
        }
    }
}
